package com.wxsong.test.nacos.service.user;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Service;

/**
 * 描述：
 *
 * @Author songweixing
 * @Date 2020/1/2
 */
@Service
public class UserServiceImpl implements UserService {

    public JSONArray userList() {
        return userListData();
    }

    private JSONArray userListData(){
        JSONArray jsonArray = new JSONArray();
        for (int i=0; i<10; i++){
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("id_"+i, i);
            jsonObject.put("name", "tom_"+i);
            jsonObject.put("age", i);
            jsonArray.add(jsonObject);
        }
        return jsonArray;
    }
}
